package com.demo.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.demo.common.R;
import com.demo.domain.Employee;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;


import javax.servlet.http.HttpServletRequest;


public interface EmployeeService extends IService<Employee> {

    /**
     * 登录
     *
     * @param request
     * @param employee
     * @return
     */
    R<Employee> login(HttpServletRequest request, @RequestBody Employee employee);


    /**
     * 退出
     *
     * @param request
     * @return
     */
    public R<String> logout(HttpServletRequest request);

    /**
     * 添加员工信息
     *
     * @param employee
     * @return
     */
    R<String> save(HttpServletRequest request, @RequestBody Employee employee);

    /**
     * 分页查询所有信息
     *
     * @return
     */
    R<Page> page(int page, int pageSize, String name);


    /**
     * 修改员工信息
     * @param request
     * @param employee
     * @return
     */
    R<String> update(HttpServletRequest request,@RequestBody Employee employee);


    /**
     * 根据id回显数据
     * @param id
     * @return
     */
    R<Employee> getById(@PathVariable Long id);

    /**
     * 根据id删除数据
     * @param id
     * @return
     */
    R<String> delete(@PathVariable Long id);
}
